package com.freecloud.graphql.resoliver;

import com.coxautodev.graphql.tools.GraphQLQueryResolver;
import com.freecloud.graphql.vo.ClassesVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @Author: maomao
 * @Date: 2022/1/13 4:10 PM
 */
@Slf4j
@Component
public class ClassesResolver implements GraphQLQueryResolver {

    public ClassesVo findClasses(String code) {
        if (code == null || code.length() < 1 || "code1".equals(code)) {
            return null;
        }
        ClassesVo classesVo = new ClassesVo();
        classesVo.setCode("code2");
        classesVo.setName("name2");
        return classesVo;
    }
}
